package com.linkhub.oms.admin.modules.user.accountrecharge.domain.vo;

import com.linkhub.oms.common.util.QtBigDecimalUtil;
import com.linkhub.oms.entity.UserRechargeRecordEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDate;

/**
 * <p>
 * 用户充值记录VO
 * </p>
 *
 * @author Frank
 * @since 2024-05-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "用户充值记录VO", description = "用户充值记录VO")
@NoArgsConstructor
public class UserRechargeRecordVO implements Serializable {

    @ApiModelProperty(value = "主键")
    private Long id;

    @ApiModelProperty(value = "交易id")
    private String transactionId;

    @ApiModelProperty(value = "用户id")
    private String merchantUserId;

    @ApiModelProperty(value = "用户名称")
    private String merchantUserName;

    @ApiModelProperty(value = "提交日期")
    private LocalDate submitDate;

    @ApiModelProperty(value = "转账币种")
    private String transferCurrencyType;

    @ApiModelProperty(value = "转账金额")
    private String transferAmount;

    @ApiModelProperty(value = "转账日期")
    private LocalDate transferDate;

    @ApiModelProperty(value = "充值提交时的汇率,币种=USD")
    private String transferExchangeRate;

    @ApiModelProperty(value = "手续费币种")
    private String feeCurrencyType;

    @ApiModelProperty(value = "手续费")
    private String fee;

    @ApiModelProperty(value = "到账金额_币种同转账金额")
    private String receivedAmount;

    @ApiModelProperty(value = "到账的汇率,币种=USD")
    private String receivedExchangeRate;

    @ApiModelProperty(value = "到账日期")
    private LocalDate receivedDate;

    @ApiModelProperty(value = "充值状态：0-审核中 1-已到账 2-已拒绝")
    private Integer rechargeStatus;

    @ApiModelProperty(value = "拒绝原因，审核拒绝时填写")
    private String refuseReason;


    public UserRechargeRecordVO(UserRechargeRecordEntity entity) {
        this.id = entity.getId();
        this.transactionId = entity.getTransactionId();
        this.merchantUserId = entity.getUserId();
        this.submitDate = entity.getSubmitDate();
        this.transferCurrencyType = entity.getTransferCurrencyType();
        this.transferAmount = QtBigDecimalUtil.toString(entity.getTransferAmount());
        this.transferDate = entity.getTransferDate();
        this.transferExchangeRate = QtBigDecimalUtil.toString(entity.getTransferExchangeRate());
        this.receivedAmount = QtBigDecimalUtil.toString(entity.getReceivedAmount());
        this.receivedExchangeRate = QtBigDecimalUtil.toString(entity.getReceivedExchangeRate());
        this.feeCurrencyType = entity.getFeeCurrencyType();
        this.fee = QtBigDecimalUtil.toString(entity.getFee());
        this.receivedDate = entity.getReceivedDate();
        this.rechargeStatus = entity.getRechargeStatus().getCode();
        this.refuseReason = entity.getRefuseReason();
    }

}
